<br>
<br>
<h2> Leave a comment </h2>

<form class="post-new-comment" id="comment-form" method="POST" action="{{ .Site.Params.staticman_api }}">
  <input type="hidden" name="options[redirect]" value="{{ .Permalink }}#post-submitted">
  <input type="hidden" name="option[redirectError]" value="{{ .Permalink }}#post-error">
  <input name="fields[name]" type="text" class="post-comment-field" placeholder="Your name"> 
  <input type="hidden" name="options[parent]" value="{{ .File.BaseFileName }}">
  <input type="hidden" name="options[entryId]" value="{{ .File.BaseFileName }}">
  <input name=fields[reply_to] type="hidden" value="">
  <!--<input name="fields[email]" type="text" class="post-comment-field" placeholder="Your email (will remain private)">-->
  <input name="options[slug]" type="hidden" value="{{ .File.BaseFileName }}">
  <textarea name="fields[body]" class="post-comment-field" placeholder="24-08-2021 CURRENTLY OFFLINE, SUFFERED HARDWARE FAILURE AND DIDN'T FIX IT YET - Write your message here. Feel free to use markdown.
N.B. the comments are processed by a raspberry pi from my home. If the connection is gone, please send me an email." rows="10"></textarea>
	<div class="g-recaptcha" data-sitekey="{{ .Site.Params.recaptcha_sitekey }}" data-callback="enableBtn"></div>
	<input type="submit" class="post-comment-field btn" value="Submit" id="submit_button">
</form>

<script type="text/javascript">
	document.getElementById("submit_button").disabled = true;
</script>

<script type="text/javascript">
	function enableBtn(){
		document.getElementById("submit_button").disabled = false;
	}
</script>

<div id="post-submitted" class="dialog">
<h3>Thank you</h3>
  <p>Your post has been submitted and will be published once it has been approved.</p>
  <!--  <p><a href="https://github.com/eduardoboucas/hugo-plus-staticman/pulls">Click here</a> to see the pull request you generated.</p> -->
  <p><a href="#" class="btn">OK</a></p>
</div>

<div id="post-error" class="dialog">
	<h3> Something went wrong! </h3>
	<p> Your comment has not been submitted. Return to the page by clicking OK. </p>
	<p><a href="#" class="btn">OK</a></p>
</div>
